
import 'osc_author.dart';
import 'osc_image_entity.dart';
import 'osc_image_simple_entity.dart';
import 'osc_statistics.dart';

class OscEventListEntity {
	OscImageSimple image;
	List<OscImage> images;
	int newsId;
	OscAuthor author;
	OscEventExtra extra;
	String href;
	int id;
	String body;
	String title;
	int type;
	String pubDate;
	OscStatistics statistics;

	OscEventListEntity({this.image, this.images, this.newsId, this.author, this.extra, this.href, this.id, this.body, this.title, this.type, this.pubDate, this.statistics});

	OscEventListEntity.fromJson(Map<String, dynamic> json) {
		image = json['image'] != null ? new OscImageSimple.fromJson(json['image']) : null;
		if (json['images'] != null) {
			images = new List<OscImage>();(json['images'] as List).forEach((v) { images.add(new OscImage.fromJson(v)); });
		}
		newsId = json['newsId'];
		author = json['author'] != null ? new OscAuthor.fromJson(json['author']) : null;
		extra = json['extra'] != null ? new OscEventExtra.fromJson(json['extra']) : null;
		href = json['href'];
		id = json['id'];
		body = json['body'];
		title = json['title'];
		type = json['type'];
		pubDate = json['pubDate'];
		statistics = json['statistics'] != null ? new OscStatistics.fromJson(json['statistics']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.image != null) {
      data['image'] = this.image.toJson();
    }
		if (this.images != null) {
      data['images'] =  this.images.map((v) => v.toJson()).toList();
    }
		data['newsId'] = this.newsId;
		if (this.author != null) {
      data['author'] = this.author.toJson();
    }
		if (this.extra != null) {
      data['extra'] = this.extra.toJson();
    }
		data['href'] = this.href;
		data['id'] = this.id;
		data['body'] = this.body;
		data['title'] = this.title;
		data['type'] = this.type;
		data['pubDate'] = this.pubDate;
		if (this.statistics != null) {
      data['statistics'] = this.statistics.toJson();
    }
		return data;
	}
}


class OscEventExtra {
	String eventEndDate;
	int eventApplyCount;
	int eventStatus;
	int eventType;
	String eventStartDate;

	OscEventExtra({this.eventEndDate, this.eventApplyCount, this.eventStatus, this.eventType, this.eventStartDate});

	OscEventExtra.fromJson(Map<String, dynamic> json) {
		eventEndDate = json['eventEndDate'];
		eventApplyCount = json['eventApplyCount'];
		eventStatus = json['eventStatus'];
		eventType = json['eventType'];
		eventStartDate = json['eventStartDate'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['eventEndDate'] = this.eventEndDate;
		data['eventApplyCount'] = this.eventApplyCount;
		data['eventStatus'] = this.eventStatus;
		data['eventType'] = this.eventType;
		data['eventStartDate'] = this.eventStartDate;
		return data;
	}
}
